/**
 *  @summary 文章模块
 *  @author 超哥
 *  @summary ...
 */
import * as channelApi from '@/api/channel';
export default {
  namespaced: true,
  state: {
    channelList: [],
  },
  mutations: {
    SET_CHANNEL_LIST(state, newValue) {
      state.channelList = newValue;
    }
  },
  actions: {
    async updateChannelList(context) {
      // 发请求
      // 拿到数据
      const res = await channelApi.getChannelList();
      // 把数据传给mutation
      // mutation改数据
      context.commit('SET_CHANNEL_LIST', res)
    }
  }
}
